import { axios } from '@/utils/request'

const api = {
  dashboardData: '/dashboard/data',
  dashboardOrderData: '/dashboard/order-data',
  dashboardGoodsData: '/dashboard/goods-data',
  getOperations:'/dashboard/operations',
  saveOperations:'/dashboard/operations'
}

export default api

//总销售额，商品总数，用户总量，订单总数
export function dashboardData (parameter) {
  return axios({
    url: api.dashboardData,
    method: 'get',
    params: parameter
  })
}
//商品订单数据和店铺销售总体排行
export function dashboardOrderData (parameter) {
  return axios({
    url: api.dashboardOrderData,
    method: 'get',
    params: parameter
  })
}
//商品销量数据
export function dashboardGoodsData (parameter) {
    return axios({
      url: api.dashboardGoodsData,
      method: 'get',
      params: parameter
    })
}
//获取常用操作
export function getOperations (parameter) {
    return axios({
      url: api.getOperations,
      method: 'get',
      params: parameter
    })
}
  //保存常用操作
export function saveOperations (parameter) {
    return axios({
      url: api.saveOperations,
      method: 'post',
      data: parameter
    })
}